<ui:composition 
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">


    <p:panel id="pConversorMedida"
        header="Conversor de medida"
        rendered="#{catalogoBean.muestraConversorMedida}" >

        <p:messages showDetail="true" />

         <h:panelGrid columns="3" width="250" >             
             
            <h:outputText value="De:" />
            <h:panelGroup>
                <p:inputText value="#{conversorMedidasBean.desde1}" size="3" requiredMessage="El campo 1 es obligatorio" >
                     <f:convertNumber />
                 </p:inputText>
                 /
                 <p:inputText value="#{conversorMedidasBean.desde2}" size="3" requiredMessage="El campo 2 es obligatorio">
                     <f:convertNumber />
                 </p:inputText>
                 -
                 <p:inputText value="#{conversorMedidasBean.desde3}" size="3" requiredMessage="El campo 3 es obligatorio">
                     <f:convertNumber />
                 </p:inputText>

            </h:panelGroup>
            <h:outputText value="#{conversorMedidasBean.desdeR}" />

            <h:outputText value="Para:" />
            <h:panelGroup>
                <p:inputText value="#{conversorMedidasBean.para1}" size="3" requiredMessage="El campo 4 es obligatorio">
                     <f:convertNumber />
                 </p:inputText>
                 /
                 <p:inputText value="#{conversorMedidasBean.para2}" size="3" requiredMessage="El campo 5 es obligatorio">
                     <f:convertNumber />
                 </p:inputText>
                 -
                 <p:inputText value="#{conversorMedidasBean.para3}" size="3" requiredMessage="El campo 6 es obligatorio">
                     <f:convertNumber />
                 </p:inputText>
            </h:panelGroup>
            <h:outputText value="#{conversorMedidasBean.paraR}" />

        </h:panelGrid>
        <h:panelGroup>
            <p:commandButton value="Calcular" icon="processValid16" 
                             action="#{conversorMedidasBean.validadMedidas}" update="pConversorMedida"/>

            <p:commandButton value="Borrar"   icon="clean16"        
                             action="#{conversorMedidasBean.borrarValores}"  update="pConversorMedida" />
            
            <p:commandButton value="Cerrar" icon="delete16" id="btnCancelar"
                             actionListener="#{catalogoBean.setMuestraConversorMedida(false)}"
                             process="@this"
                             update="@form"  />

            <p:commandButton value="Ayuda"    icon="info16"         action="#"   update="gCatalogo"/>
        </h:panelGroup>        

    </p:panel>
    

</ui:composition>
